<?php
namespace Admin\Controller;
use Common\Model\FollowModel;

use Think\Controller;
use Admin\Controller\AdminController;

use Think\Verify;

class FuturesUserCodeController extends AdminController{

	/*页面加载*/
	public function index(){

		/*时间查询*/
		$create_time=I('get.create_time');
		if($create_time){
			$sql['create_time']=array('egt',strtotime($create_time));
			$this->assign('create_time',$create_time);
		}
		$end_time=I('get.end_time');
		if($end_time){
			$end_time=strtotime($end_time)+86399;
			$sql['_string']='create_time <='.$end_time;
			$this->assign('end_time',$end_time);
		}
		$mobile = I('get.mobile');
		if($mobile){
			$sql['mobile'] = array('like',"%".trim($mobile)."%");
		}


		//分页
		$count	=	M('follow_code')->where($sql)->count();// 查询满足要求的总记录数
		$Page       = new \Think\Page($count,20);// 实例化分页类 传入总记录数和每页显示的记录数(25)
		$show       = $Page->show();// 分页显示输出

		/*查询验证码列表*/
		$list = M('follow_code')->where($sql)->limit($Page->firstRow.','.$Page->listRows)->order('create_time desc')->select();
		$this->assign('_page',$show);
		$this->assign('list',$list);
		$this->display();
	}
}
